<div class="nav">
	<ul>
		<li><a {{if $type=='sypl'}}class="cur"{{/if}} href="/management/admin_recom.php?type=sypl">首页评论推荐</a></li>
		<li><a {{if $type=='qysy'}}class="cur"{{/if}} href="/management/admin_recom.php?type=qysy&s_type=1">企业首页推荐</a></li>
		<li><a {{if $type=='qytj'}}class="cur"{{/if}} href="/management/admin_recom.php?type=qytj">企业页面推荐企业</a></li>
		<div class="clear"></div>
	</ul>
	{{if $type=="qysy"}}
	<br/>
	<ul>
		{{foreach from=$cateSub key=key item=item}}
		<li><a {{if $key==$s_type}}class="cur"{{/if}} href="/management/admin_recom.php?type=qysy&s_type={{$key}}">{{$item}}</a></li>
		{{/foreach}}
		<div class="clear"></div>
	</ul>
	{{/if}}
</div>
<p style="color:red;clear:both;margin:5px 0;">注意：{{$info}}<p>
<form method="post">
<input type="hidden" name="method" value="save">
<input type="hidden" name="type" value="{{$type}}">
<input type="hidden" name="s_type" value="{{$s_type}}">
<table>
	{{foreach from=$rows key=key item=item}}
	<tr>
		<td>推荐ID：</td>
		<td>
			<input type="text" name="recom_id[{{$key}}]" id="recom_id{{$key}}" value="{{$item.recom_id}}"/>
			<input type="hidden" name="id[{{$key}}]" value="{{$item.id}}">
			<input type="button" value="填充" onclick="getInfo('{{$key}}')"></td>
		<td>标题：</td>
		<td><input type="text" name="title[{{$key}}]" id="title{{$key}}" value="{{$item.title}}"/></td>
		<td>内容：</td>
		<td><input type="text" name="content[{{$key}}]" id="content{{$key}}" value="{{$item.content}}"/></td>
	</tr>
	{{/foreach}}
	<tr>
		<td>推荐ID：</td>
		<td>
			<input type="text" name="recom_id[888]" id="recom_id888" value=""/>
			<input type="button" value="填充" onclick="getInfo('888')"></td>
		<td>标题：</td>
		<td><input type="text" name="title[888]" id="title888" value=""/></td>
		<td>内容：</td>
		<td><input type="text" name="content[888]" id="content888" value=""/></td>
	</tr>
	<tr>
		<td colspan="2"><input type="submit" value="提交"></td>
	</tr>
</table>
</form>
<script>
	function getInfo(ele_id)
	{
		var id = parseInt($("#recom_id"+ele_id).val());
		if(isNaN(id)){
			alert("请准确填写推荐ID");
			return false;
		}
		$.ajax({
			type : "post",
			url : "/management/admin_recom.php",
			data : {method:"getCorInfo",id:id},
			dataType : "json",
			success : function(msg){
				$("#title"+ele_id).val(msg.name);
			}
		})
	}
</script>
